home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- TEST(1L) TEST(1L)
- NAME
- test - check file types and compare values
- SYNOPSIS
- test [expr]
- DESCRIPTION
- This manual page documents the GNU version of test.
- test returns a status of 0 (true) or 1 (false) depending on
- ____ the evaluation of the conditional expression expr. Expres-
- sions may be unary or binary. Unary expressions are often
- used to examine the status of a file. There are string
- operators and numeric comparison operators as well.
- ____ -b file
- ____ True if file exists and is block special.
- ____ -c file
- ____ True if file exists and is character special.
- ____ -d file
- ____ True if file exists and is a directory.
- ____ -e file
- ____ True if file exists
- ____ -f file
- ____ True if file exists and is a regular file.
- ____ -g file
- ____ True if file exists and is set-group-id.
- ____ -k file
- ____ True if file has its ``sticky'' bit set.
- ____ -L file
- ____ True if file exists and is a symbolic link.
- ____ -p file
- ____ True if file exists and is a named pipe.
- ____ -r file
- ____ True if file exists and is readable.
- ____ -s file
- ____ True if file exists and has a size greater than zero.
- ____ -S file
- ____ True if file exists and is a socket.
- __ -t [fd]
- __ __ True if fd is opened on a terminal. If fd is omitted,
- it defaults to 1 (standard output).
- ____ -u file
- ____ True if file exists and its set-user-id bit is set.
- ____ -w file
- ____ True if file exists and is writable.
- ____ -x file
- ____ True if file exists and is executable.
- ____ -O file
- ____ True if file exists and is owned by the effective user
- id.
- ____ -G file
- Page 1
- TEST(1L) TEST(1L)
- ____ True if file exists and is owned by the effective group
- id.
- _____ _____ file1 -nt file2
-
-
-
-
-
-
-
-
-
-
-
-
- _____ True if file1 is newer (according to modification date)
- _____ than file2.
- _____ _____ file1 -ot file2
- _____ True if file1 is older than file2.
- _____ ____ file1 -ef file
- _____ _____ True if file1 and file2 have the same device and inode
- numbers.
- ______ -z string
- ______ True if the length of string is zero.
- ______ -n string
- ______ string
- ______ True if the length of string is non-zero.
- _______ _______ string1 = string2
- True if the strings are equal.
- _______ _______ string1 != string2
- True if the strings are not equal.
- ____ ! expr
- ____ True if expr is false.
- _____ _____ expr1 -a expr2
- _____ _____ True if both expr1 and expr2 are true.
- _____ _____ expr1 -o expr2
- _____ _____ True if either expr1 or expr2 is true.
- ____ ____ arg1 OP arg2
- OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These
- ____ arithmetic binary operators return true if arg1 is
- equal, not-equal, less-than, less-than-or-equal,
- ____ greater-than, or greater-than-or-equal than arg2,
- ____ ____ respectively. arg1 and arg2 may be positive integers,
- ______ negative integers, or the special expression -l string,
- ______ which evaluates to the length of string.
- Page 2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-